package pl.alipiec.stockview;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.hornetq.core.logging.Logger;

import pl.alipiec.stockview.master.IndexData;

public class Configuration {
	
	public static final String config="config/index.properties";
	
	private IndexData indexes;
	private Logger log = Logger.getLogger(Configuration.class);
	private int frequency;
	
	public void loadConfiguration() {
		
		Properties indexProps = new Properties();
		
		try {
			indexProps.load(new FileInputStream(config));
			
			
			frequency = Integer.parseInt(indexProps.getProperty("frequency"));
			indexes = new IndexData(indexProps);
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
	
	public IndexData getIndexes(){
		return indexes;
	}
	
	public int getFrequency(){
		return frequency;
	}

}
